package com.chanta.server.persistence;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * TODO Please comment this class..
 * 
 * @author Hakan Özdemir - Vendoo Inc.
 * @date 03.11.2013
 * 
 */
@PersistenceCapable
public class Template {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String templatename;

	@Persistent
	private String description;

	@Persistent
	private Date creationDate;

	@Persistent
	private String status;

	@Persistent
	private String templateType;

	@Persistent
	private Set<Key> fields;

	/** do not rename */
	@Persistent
	private Portal portal;

	@Persistent(mappedBy = "template")
	private List<Item> items;

	/**
	 * Getter for templatename.
	 * 
	 * @return templatename
	 */
	public String getTemplatename() {
		return templatename;
	}

	/**
	 * Setter for templatename.
	 * 
	 * @param templatename
	 *            the templatename to set
	 */
	public void setTemplatename(String templatename) {
		this.templatename = templatename;
	}

	/**
	 * Getter for description.
	 * 
	 * @return description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Setter for description.
	 * 
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Getter for creationDate.
	 * 
	 * @return creationDate
	 */
	public Date getCreationDate() {
		return creationDate;
	}

	/**
	 * Setter for creationDate.
	 * 
	 * @param creationDate
	 *            the creationDate to set
	 */
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	/**
	 * Getter for status.
	 * 
	 * @return status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * Setter for status.
	 * 
	 * @param status
	 *            the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * Getter for templateType.
	 * 
	 * @return templateType
	 */
	public String getTemplateType() {
		return templateType;
	}

	/**
	 * Setter for templateType.
	 * 
	 * @param templateType
	 *            the templateType to set
	 */
	public void setTemplateType(String templateType) {
		this.templateType = templateType;
	}

	/**
	 * Getter for fields.
	 * 
	 * @return fields
	 */
	public Set<Key> getFields() {
		return fields;
	}

	/**
	 * Setter for fields.
	 * 
	 * @param fields
	 *            the fields to set
	 */
	public void setFields(Set<Key> fields) {
		this.fields = fields;
	}

	/**
	 * Getter for portal.
	 * 
	 * @return portal
	 */
	public Portal getPortal() {
		return portal;
	}

	/**
	 * Setter for portal.
	 * 
	 * @param portal
	 *            the portal to set
	 */
	public void setPortal(Portal portal) {
		this.portal = portal;
	}

	/**
	 * Getter for items.
	 * 
	 * @return items
	 */
	public List<Item> getItems() {
		return items;
	}

	/**
	 * Setter for items.
	 * 
	 * @param items
	 *            the items to set
	 */
	public void setItems(List<Item> items) {
		this.items = items;
	}
}
